﻿namespace SDi.Login.Model
{
    public class Capability : DynamicModel
    {
        #region Fields
        private int _idCapability;
        private string _code;
        private string _name;
        #endregion

        #region Constructors
        public Capability()
            : base("[dbo].[V_CAPABILITY_USER]", "IdCapability")
        {

        }

        public Capability(int idCapability = -1, string name = null, string code = null) 
            : base("[dbo].[V_CAPABILITY_USER]", "IdCapability")
        {
            IdCapability = idCapability;
            Name = name;
            Code = code;
        }
        #endregion

        #region Properties
        public string Name
        {
            get { return _name; }
            set
            {
                if (value != null)
                {
                    _name = value;
                }
            }
        }
        
        public string Code
        {
            get { return _code; }
            set
            {
                if (value != null)
                {
                    _code = value;
                }
            }
        }

        public int IdCapability
        {
            get { return _idCapability; }
            set {
                if (value >= 0)
                {
                    _idCapability = value;
                }
            }
        }
        #endregion

    }
}
